package com.health.system.dao.system;

import java.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import com.health.system.javacommon.base.BaseIbatis3Dao;
import com.health.system.model.system.*;
import com.health.system.dao.system.*;
import com.health.system.service.system.impl.*;
import com.health.system.service.system.*;
import org.springframework.stereotype.Component;

@Component
public class RolePermissionDao extends
		BaseIbatis3Dao<RolePermission, java.lang.String> {

	public Class getEntityClass() {
		return RolePermission.class;
	}

	public void saveOrUpdate(RolePermission entity) {
		if (entity.getId() == null)
			save(entity);
		else
			update(entity);
	}

	public Page findByPageRequest(PageRequest pageRequest) {
		return pageQuery("RolePermission.pageSelect", pageRequest);
	}

	public List getRolePermissionList(RolePermission rolepermission) {
		List list = null;
		list = getList("RolePermission.getRolePermissionList", rolepermission);
		return list;
	}

	public List getPermissionList(Permission permission) {
		List list = null;
		list = getList("Permission.pageSelect", permission);
		return list;
	}

	public int delete(RolePermission u) {
		int i = -1;
		i = delete("RolePermission.delrolepermission", u);
		return i;
	}

	public int saverolepermissionlist(RolePermission u) {
		int i = -1;
		i = save("RolePermission.saverolepermissionlist", u);
		return i;
	}
	/**
	 * 查询当前操作员角色对应的权限ID集合
	 * @param map
	 * String sort 权限类型
	 * String userId 操作员ID
	 * @return List<RolePermission>
	 */
	public List getPermissionByMap(Map map) {
		List list = null;
		list = getList("Permission.getPermissionByMap", map);
		return list;
	}
	
}
